/*
 * @Author: windys
 * @Description: 
 * @Date: 2022-03-09 16:13:20
 */
import { computed } from "vue";
import { formatDateTime } from './index'

export default function () {
    const filterTime = computed(() => {
        return function (time) {
            return formatDateTime(time)
        }
    })


    const filterGameStatus = computed(() => {
        // 0:未发布 1 未开始 2 比赛中 3已结束
        return function (v) {
            let arr = ['未发布', '未开始', '比赛中', '已结束', '已下架']
            return arr[v]
        }
    })

    const filterQueStatus = computed(() => {
        // 是否已回答 0 未回答 1已回答 2已拒绝 3已超时 4已下架
        return function (v) {
            let arr = ['未回答', '已回答', '已拒绝', '已超时', '已下架']
            return arr[v]
        }
    })

    const filterpayType = computed(() => {
        // 0金石支付，22支付宝，30微信，99苹果
        return function (v) {
            switch (v) {
                case 0:
                    return '金石支付'
                    break;
                case 22:
                    return '支付宝'
                    break;
                case 30:
                    return '微信'
                    break;
                case 99:
                    return '苹果'
                    break;
                default:
                    break;
            }
        }
    })



    const filterOrderType = computed(() => {
        // 0金石支付，22支付宝，30微信，99苹果
        return function (v) {
            switch (v) {
                case 1:
                    return '充值'
                    break;
                case 2:
                    return '财乎币兑换金石'
                    break;
                case 10:
                    return '问答提问'
                    break;
                case 11:
                    return '问答围观'
                    break;
                case 20:
                    return '文章购买'
                    break;
                case 21:
                    return '文章打赏'
                    break;
                case 30:
                    return '课程购买'
                    break;
                case 31:
                    return '课程打赏'
                    break;
                case 40:
                    return '直播付费'
                    break;
                case 41:
                    return '直播礼物'
                    break;
                case 42:
                    return '直播打赏'
                    break;
                case 43:
                    return '直播课程购买'
                    break;
                case 51:
                    return '短视频购买'
                    break;
                case 52:
                    return '短视频赞赏'
                    break;
                case 65:
                    return '群付费'
                    break;
                default:
                    break;
            }
        }
    })
    return {
        filterTime,
        filterQueStatus,
        filterOrderType,
        filterpayType,
        filterGameStatus
    }
}